package vo;

import java.io.Serializable;
import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "tasklist")

public class TaskList implements Serializable {

	transient private static final long serialVersionUID = 1L;

	@XmlElementWrapper(name = "tasks")
	@XmlElement(name = "task")
	public ArrayList<Task> taskList;

	public TaskList(){

		taskList = new ArrayList<Task>();
	}
	public void add(Task t){
		
		this.taskList.add(t);
	
	}

	public void remove(Task t) {
		
		this.taskList.remove(t);
	}
	
	public String toString() {
		
		String result = "";
		
		for (Task t : this.taskList)  result += t.toString() + "\n";
		
		return result;
		
	}
}







